package com.lucher.mes.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.lucher.mes.po.Produceproduct;
import com.lucher.mes.po.Produceschedule;
import com.lucher.mes.po.Producescheduleproblem;
import org.apache.ibatis.annotations.Param;

public interface ProducescheduleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Produceschedule record);

    int insertSelective(Produceschedule record);

    Produceschedule selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Produceschedule record);

    int updateByPrimaryKey(Produceschedule record);
    
    //自定义接口
    List<Produceschedule> findByList(Produceschedule record);
    List<Produceschedule> findByListForPage(Produceschedule record);
    int findByCount(Produceschedule record);
    public Integer saveBatch(ArrayList<Produceschedule> records);
    //每个人的生产统计，根据当前的生产任务
    List<Produceschedule> findProducedCountByProducecode(Produceschedule record);
    int findProducedCountByPrisonercode(Produceschedule record);


    List<Map<String, Object>> getMouthReoprtByPrisonercode(String prisonercode);

    List<Map<String,Object>> getRankList(Producescheduleproblem record);

    // 获取人员当天返工率
    String getReworkRate(
            @Param("prisonercode")String prisonercode,
            @Param("productcode") String productcode,
            @Param("linecode") String linecode
           );
}